#include "MyLogger.h"
#include "DataBuffer.h"

int TestFunction(A aval)
{
    return aval.sum();
}

A PoorFactory(int a,int b,int c,uint8_t d)
{
    return A(a,b,c,d);
}

int main()
{
    std::cout << __LINE__ << std::endl;
    // A a{};
    // A b{};
    // b = a;
    // A d{a};
    // a.Dump();

    // A a{1,2,3,4};
    // TestFunction(a);

    // A a = PoorFactory(3,4,5,6);

    // A * pa = new A{};

    // pa->Dump();

    // delete pa;

    A a{2,7,1,8};
    A b{3,1,4,1};
    CDataBuffer bufferA{"bufferA", &a, sizeof(A)};
    // bufferA.Dump();

    CDataBuffer bufferB{"bufferB", &b, sizeof(A)};
    // bufferB.Dump();

    // CDataBuffer bufferC(bufferA);
    // bufferC.Dump();

    // CDataBuffer bufferD(bufferC);
    // bufferD.Dump();
    std::cout << __LINE__ << std::endl;
    bufferA = bufferB;
    // bufferA.Dump();

    // bufferB = bufferB;
    // bufferB.Dump();

    std::cout << __LINE__ << std::endl;
}